import {view, ViewGroup} from "adajs";
import DetailService from "./state.js";
import Bar from "../../../../controls/bar";
import LodgeDetail from "./../../../../controls/detail/lodge";
import {getQueryInfo} from "./../../../../lib/helper";

@view({
    className: "detail",
    template: "./template.html",
    style: "./style.scss",
    dataset: {
        service: DetailService
    }
})
class Detail extends ViewGroup {
    tags() {
        return {
            bar: Bar,
            detail: LodgeDetail
        };
    }

    onready() {
        let r = getQueryInfo();
        if (r.id) {
            this.commit("update", {id: r.id});
        }
    }
}

export default Detail;